home *** CD-ROM | disk | FTP | other *** search
/ AmigActive 10 / AACD 10.iso / AACD / Magazine / Morphos / GCC / ppc-amigaos / include / powerup / ppclib / interface.i < prev    next >
Text File  |  2000-02-28  |  5KB  |  156 lines

  1.     IFND POWERUP_PPCLIB_INTERFACES_I
  2. POWERUP_PPCLIB_INTERFACES_I    SET    1
  3.  
  4.     include    "exec/types.i"
  5.  
  6. ;/*
  7. ; * Structure which is used on the PPC side to call
  8. ; * AmigaOS library functions or sub routines.
  9. ; *
  10. ; */
  11.  
  12. ;/*****************************/
  13. ;/* About the CacheMode field */
  14. ;/*****************************/
  15.  
  16. ;/*
  17. ; * For calling functions from the PPC under M68k AmigaOS or for
  18. ; * calling functions on the PPC Supervisor mode you have to care
  19. ; * for the cache issues. Please read the Cache chapter in the
  20. ; * docs/powerup.guide about the cache problems involved.
  21. ; * If you do something wrong here you can expect that you loose
  22. ; * data, get wrong data or simply crash the machine.
  23. ; *
  24. ; * IF_CACHEFLUSHNO:
  25. ; * You use this mode for the cpu if your function
  26. ; * touches no memory both cpus use.
  27. ; *
  28. ; * Example: Close(File)
  29. ; *          If you call this function by the PPC there`s no need
  30. ; *          to flush the cache because the PPC isn`t allowed to
  31. ; *          touch any memory which has to do with the File BPTR.
  32. ; * ATTENTION:
  33. ; *          The PPC MUST NOT be used to poke into AmigaOS system
  34. ; *          structures.
  35. ; *
  36. ; * IF_CACHEFLUSHALL:
  37. ; * You use this mode for the cpu if your function
  38. ; * touches memory both cpus use and it`s no simple memory area
  39. ; * which may be flushed individually. This should be used by default.
  40. ; *
  41. ; * Example: OpenWindowTagList(NewWindow,TagList)
  42. ; *          Here you pass a complex data structure which may use
  43. ; *          memory areas at several different areas.
  44. ; *
  45. ; * IF_CACHEFLUSHAREA:
  46. ; * You use this mode for the cpu if your function
  47. ; * touches memory both cpus use and it`s a memory area which isn`t
  48. ; * very big. It depends on the size and how many lines are dirty
  49. ; * if this is faster than IF_CACHEFLUSHALL.
  50. ; * With the Start and Length fields of each cpu you can define
  51. ; * the area.
  52. ; *
  53. ; * Example: Write(File,Address,Length)
  54. ; *          When the PPC runs this function the PPC must make sure
  55. ; *          that all data in the to be written memory area is in
  56. ; *          in the memory and not only in the cache.
  57. ; *
  58. ; * IF_CACHEINVALIDAREA: (V45)
  59. ; * You use this mode for the cpu if your function
  60. ; * touches memory both cpus use and it`s a memory area where you
  61. ; * don`t care for valid data anymore.
  62. ; * With the Start and Length fields of each cpu you can define
  63. ; * the area.
  64. ; *
  65. ; * Example: Read(File,Address,Length)
  66. ; *          When the PPC runs this function the PPC has no need
  67. ; *          anymore for anything which is in its cache for the
  68. ; *          area the Address and Length define, so you could
  69. ; *          invalidate this instead of doing a cacheflush which
  70. ; *          may write back dirty lines.
  71. ; *          Be VERY careful about this.
  72. ; *
  73. ; * ATTENTION! The Address must be 32Byte aligned, so you should always
  74. ; * use PPCAllocMem for data which is used on the M68k and PPC
  75. ; * You are NOT allowed to use normal pools for exchanging data between
  76. ; * the M68k and PPC.
  77. ; *
  78. ; * IF_ASYNC: (V45)
  79. ; * If you use this flag, the function is called asynchronous and
  80. ; * the PPC doesn`t have to wait for a result.
  81. ; * This flag is only checked in the M68kCacheMode field.
  82. ; * This also means that the result of the PPCCall#? function
  83. ; * is meaningless.
  84. ; * Normally this flag doesn`t really fit into a CacheMode flag, but
  85. ; * well..too bad i haven`t declared another flag field there.
  86. ; */
  87.  
  88.     STRUCTURE    Caos,0
  89.     LABEL    caos_Function
  90.     LONG    caos_Offset
  91.     ULONG    caos_M68kCacheMode;
  92.     APTR    caos_M68kStart;
  93.     ULONG    caos_M68kLength;
  94.     ULONG    caos_PPCCacheMode;
  95.     APTR    caos_PPCStart;
  96.     ULONG    caos_PPCLength;
  97.     ULONG    caos_d0
  98.     ULONG    caos_d1
  99.     ULONG    caos_d2
  100.     ULONG    caos_d3
  101.     ULONG    caos_d4
  102.     ULONG    caos_d5
  103.     ULONG    caos_d6
  104.     ULONG    caos_d7
  105.     ULONG    caos_a0
  106.     ULONG    caos_a1
  107.     ULONG    caos_a2
  108.     ULONG    caos_a3
  109.     ULONG    caos_a4
  110.     ULONG    caos_a5
  111.     ULONG    caos_a6
  112.     LABEL    caos_SIZE
  113.  
  114. IF_CACHEFLUSHNO        =    0
  115. IF_CACHEFLUSHALL    =    1
  116. IF_CACHEFLUSHAREA    =    2
  117. IF_CACHEINVALIDAREA    =    4
  118. IF_ASYNC        =    $10000
  119.  
  120. ;/*
  121. ; * Structure which is used on the M68k side to run
  122. ; * a Kernal Supervisor ElfObject. During this time
  123. ; * the multitasking on the PPC stop
  124. ; * Better allocate this struct by PPCAllocMem to get
  125. ; * a Cache Line and FPU data alignment which is an
  126. ; * automatic effect
  127. ; * PPCRunKernalModule() ONLY !!!!!!!!!!!!!!!!!!!!!
  128. ; */
  129.  
  130.     STRUCTURE    ModuleArgs,0
  131.     ULONG        ma_M68kCacheMode;
  132.     APTR        ma_M68kStart;
  133.     ULONG        ma_M68kLength;
  134.     ULONG        ma_PPCCacheMode;
  135.     APTR        ma_PPCStart;
  136.     ULONG        ma_PPCLength;
  137.     ULONG        ma_Arg1    ;/* Gpr3=C Arg1 */
  138.     ULONG        ma_Arg2    ;/* Gpr4=C Arg2  */
  139.     ULONG        ma_Arg3    ;/* Gpr5=C Arg3  */
  140.     ULONG        ma_Arg4    ;/* Gpr6=C Arg4  */
  141.     ULONG        ma_Arg5    ;/* Gpr7=C Arg5  */
  142.     ULONG        ma_Arg6    ;/* Gpr8=C Arg6  */
  143.     ULONG        ma_Arg7    ;/* Gpr9=C Arg7  */
  144.     ULONG        ma_Arg8    ;/* Gpr10=C Arg8 */
  145.     DOUBLE        ma_FArg1;/* FPR1=C FPU Arg1 */
  146.     DOUBLE        ma_FArg2;/* FPR2=C FPU Arg2 */
  147.     DOUBLE        ma_FArg3;/* FPR3=C FPU Arg3 */
  148.     DOUBLE        ma_FArg4;/* FPR4=C FPU Arg4 */
  149.     DOUBLE        ma_FArg5;/* FPR5=C FPU Arg5 */
  150.     DOUBLE        ma_FArg6;/* FPR6=C FPU Arg6 */
  151.     DOUBLE        ma_FArg7;/* FPR7=C FPU Arg7 */
  152.     DOUBLE        ma_FArg8;/* FPR8=C FPU Arg8 */
  153.     LABEL        ModuleArgs_SIZEOF
  154.  
  155.     ENDC
  156.